<?php
class Group extends AppModel {
        var $name = 'Group';
        var $actsAs = array('Acl'=>'requester');        
     var $hasMany = array('User' =>
                          array('className'     => 'User',
                                'conditions'    => '',
                                'order'         => '',
                                'limit'         => '',
                                'foreignKey'    => 'group_id',
                                'dependent'     => false,
                                'exclusive'     => false,
                                'finderQuery'   => ''
                          )
                   );
 
        function parentNode(){
                if (!$this->id) {
                return null;
                }
                $data = $this->read();
 
                if (!$data['Group']['parent_id']){
                        return null;
                } else {
                        return $data['Group']['parent_id'];
                }
        }
}
?>